Cleaning up duplicate code

Signed-off-by: Yuri Tomanek <yuri@tomanek.com.au>