Tidying rx code